3.1.32 \(\int \frac {4+x}{(4+2 x+x^2) \sqrt {5+2 x+x^2}} \, dx\)

Optimal. Leaf size=44 \[ \sqrt {3} \tan ^{-1}\left (\frac {x+1}{\sqrt {3} \sqrt {x^2+2 x+5}}\right )-\tanh ^{-1}\left (\sqrt {x^2+2 x+5}\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 44, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {1025, 982, 204, 1024, 206} \begin {gather*} \sqrt {3} \tan ^{-1}\left (\frac {x+1}{\sqrt {3} \sqrt {x^2+2 x+5}}\right )-\tanh ^{-1}\left (\sqrt {x^2+2 x+5}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(4 + x)/((4 + 2*x + x^2)*Sqrt[5 + 2*x + x^2]),x]

[Out]

Sqrt[3]*ArcTan[(1 + x)/(Sqrt[3]*Sqrt[5 + 2*x + x^2])] - ArcTanh[Sqrt[5 + 2*x + x^2]]

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 982

Int[1/(((a_) + (b_.)*(x_) + (c_.)*(x_)^2)*Sqrt[(d_.) + (e_.)*(x_) + (f_.)*(x_)^2]), x_Symbol] :> Dist[-2*e, Su
bst[Int[1/(e*(b*e - 4*a*f) - (b*d - a*e)*x^2), x], x, (e + 2*f*x)/Sqrt[d + e*x + f*x^2]], x] /; FreeQ[{a, b, c
, d, e, f}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[e^2 - 4*d*f, 0] && EqQ[c*e - b*f, 0]

Rule 1024

Int[((g_) + (h_.)*(x_))/(((a_) + (b_.)*(x_) + (c_.)*(x_)^2)*Sqrt[(d_.) + (e_.)*(x_) + (f_.)*(x_)^2]), x_Symbol
] :> Dist[-2*g, Subst[Int[1/(b*d - a*e - b*x^2), x], x, Sqrt[d + e*x + f*x^2]], x] /; FreeQ[{a, b, c, d, e, f,
 g, h}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[e^2 - 4*d*f, 0] && EqQ[c*e - b*f, 0] && EqQ[h*e - 2*g*f, 0]

Rule 1025

Int[((g_.) + (h_.)*(x_))/(((a_) + (b_.)*(x_) + (c_.)*(x_)^2)*Sqrt[(d_.) + (e_.)*(x_) + (f_.)*(x_)^2]), x_Symbo
l] :> -Dist[(h*e - 2*g*f)/(2*f), Int[1/((a + b*x + c*x^2)*Sqrt[d + e*x + f*x^2]), x], x] + Dist[h/(2*f), Int[(
e + 2*f*x)/((a + b*x + c*x^2)*Sqrt[d + e*x + f*x^2]), x], x] /; FreeQ[{a, b, c, d, e, f, g, h}, x] && NeQ[b^2
- 4*a*c, 0] && NeQ[e^2 - 4*d*f, 0] && EqQ[c*e - b*f, 0] && NeQ[h*e - 2*g*f, 0]

Rubi steps

\begin {align*} \int \frac {4+x}{\left (4+2 x+x^2\right ) \sqrt {5+2 x+x^2}} \, dx &=\frac {1}{2} \int \frac {2+2 x}{\left (4+2 x+x^2\right ) \sqrt {5+2 x+x^2}} \, dx+3 \int \frac {1}{\left (4+2 x+x^2\right ) \sqrt {5+2 x+x^2}} \, dx\\ &=-\left (2 \operatorname {Subst}\left (\int \frac {1}{2-2 x^2} \, dx,x,\sqrt {5+2 x+x^2}\right )\right )-12 \operatorname {Subst}\left (\int \frac {1}{-24-2 x^2} \, dx,x,\frac {2+2 x}{\sqrt {5+2 x+x^2}}\right )\\ &=\sqrt {3} \tan ^{-1}\left (\frac {1+x}{\sqrt {3} \sqrt {5+2 x+x^2}}\right )-\tanh ^{-1}\left (\sqrt {5+2 x+x^2}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.05, size = 101, normalized size = 2.30 \begin {gather*} -\frac {1}{2} \left (1+i \sqrt {3}\right ) \tanh ^{-1}\left (\frac {-i \sqrt {3} x-i \sqrt {3}+4}{\sqrt {x^2+2 x+5}}\right )-\frac {1}{2} \left (1-i \sqrt {3}\right ) \tanh ^{-1}\left (\frac {i \sqrt {3} x+i \sqrt {3}+4}{\sqrt {x^2+2 x+5}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(4 + x)/((4 + 2*x + x^2)*Sqrt[5 + 2*x + x^2]),x]

[Out]

-1/2*((1 + I*Sqrt[3])*ArcTanh[(4 - I*Sqrt[3] - I*Sqrt[3]*x)/Sqrt[5 + 2*x + x^2]]) - ((1 - I*Sqrt[3])*ArcTanh[(
4 + I*Sqrt[3] + I*Sqrt[3]*x)/Sqrt[5 + 2*x + x^2]])/2

________________________________________________________________________________________

IntegrateAlgebraic [A]  time = 0.35, size = 71, normalized size = 1.61 \begin {gather*} -\sqrt {3} \tan ^{-1}\left (\frac {x^2}{\sqrt {3}}-\frac {(x+1) \sqrt {x^2+2 x+5}}{\sqrt {3}}+\frac {2 x}{\sqrt {3}}+\frac {4}{\sqrt {3}}\right )-\tanh ^{-1}\left (\sqrt {x^2+2 x+5}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

IntegrateAlgebraic[(4 + x)/((4 + 2*x + x^2)*Sqrt[5 + 2*x + x^2]),x]

[Out]

-(Sqrt[3]*ArcTan[4/Sqrt[3] + (2*x)/Sqrt[3] + x^2/Sqrt[3] - ((1 + x)*Sqrt[5 + 2*x + x^2])/Sqrt[3]]) - ArcTanh[S
qrt[5 + 2*x + x^2]]

________________________________________________________________________________________

fricas [B]  time = 0.41, size = 106, normalized size = 2.41 \begin {gather*} -\sqrt {3} \arctan \left (-\frac {1}{3} \, \sqrt {3} {\left (x + 2\right )} + \frac {1}{3} \, \sqrt {3} \sqrt {x^{2} + 2 \, x + 5}\right ) + \sqrt {3} \arctan \left (-\frac {1}{3} \, \sqrt {3} x + \frac {1}{3} \, \sqrt {3} \sqrt {x^{2} + 2 \, x + 5}\right ) + \frac {1}{2} \, \log \left (x^{2} - \sqrt {x^{2} + 2 \, x + 5} {\left (x + 2\right )} + 3 \, x + 6\right ) - \frac {1}{2} \, \log \left (x^{2} - \sqrt {x^{2} + 2 \, x + 5} x + x + 4\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((4+x)/(x^2+2*x+4)/(x^2+2*x+5)^(1/2),x, algorithm="fricas")

[Out]

-sqrt(3)*arctan(-1/3*sqrt(3)*(x + 2) + 1/3*sqrt(3)*sqrt(x^2 + 2*x + 5)) + sqrt(3)*arctan(-1/3*sqrt(3)*x + 1/3*
sqrt(3)*sqrt(x^2 + 2*x + 5)) + 1/2*log(x^2 - sqrt(x^2 + 2*x + 5)*(x + 2) + 3*x + 6) - 1/2*log(x^2 - sqrt(x^2 +
 2*x + 5)*x + x + 4)

________________________________________________________________________________________

giac [B]  time = 0.37, size = 108, normalized size = 2.45 \begin {gather*} -\sqrt {3} \arctan \left (-\frac {1}{3} \, \sqrt {3} {\left (x - \sqrt {x^{2} + 2 \, x + 5} + 2\right )}\right ) + \sqrt {3} \arctan \left (-\frac {1}{3} \, \sqrt {3} {\left (x - \sqrt {x^{2} + 2 \, x + 5}\right )}\right ) + \frac {1}{2} \, \log \left ({\left (x - \sqrt {x^{2} + 2 \, x + 5}\right )}^{2} + 4 \, x - 4 \, \sqrt {x^{2} + 2 \, x + 5} + 7\right ) - \frac {1}{2} \, \log \left ({\left (x - \sqrt {x^{2} + 2 \, x + 5}\right )}^{2} + 3\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((4+x)/(x^2+2*x+4)/(x^2+2*x+5)^(1/2),x, algorithm="giac")

[Out]

-sqrt(3)*arctan(-1/3*sqrt(3)*(x - sqrt(x^2 + 2*x + 5) + 2)) + sqrt(3)*arctan(-1/3*sqrt(3)*(x - sqrt(x^2 + 2*x
+ 5))) + 1/2*log((x - sqrt(x^2 + 2*x + 5))^2 + 4*x - 4*sqrt(x^2 + 2*x + 5) + 7) - 1/2*log((x - sqrt(x^2 + 2*x
+ 5))^2 + 3)

________________________________________________________________________________________

maple [A]  time = 0.01, size = 40, normalized size = 0.91 \begin {gather*} -\arctanh \left (\sqrt {x^{2}+2 x +5}\right )+\sqrt {3}\, \arctan \left (\frac {\sqrt {3}\, \left (2 x +2\right )}{6 \sqrt {x^{2}+2 x +5}}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((4+x)/(x^2+2*x+4)/(x^2+2*x+5)^(1/2),x)

[Out]

-arctanh((x^2+2*x+5)^(1/2))+3^(1/2)*arctan(1/6*3^(1/2)/(x^2+2*x+5)^(1/2)*(2*x+2))

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {x + 4}{\sqrt {x^{2} + 2 \, x + 5} {\left (x^{2} + 2 \, x + 4\right )}}\,{d x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((4+x)/(x^2+2*x+4)/(x^2+2*x+5)^(1/2),x, algorithm="maxima")

[Out]

integrate((x + 4)/(sqrt(x^2 + 2*x + 5)*(x^2 + 2*x + 4)), x)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \frac {x+4}{\left (x^2+2\,x+4\right )\,\sqrt {x^2+2\,x+5}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x + 4)/((2*x + x^2 + 4)*(2*x + x^2 + 5)^(1/2)),x)

[Out]

int((x + 4)/((2*x + x^2 + 4)*(2*x + x^2 + 5)^(1/2)), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {x + 4}{\left (x^{2} + 2 x + 4\right ) \sqrt {x^{2} + 2 x + 5}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((4+x)/(x**2+2*x+4)/(x**2+2*x+5)**(1/2),x)

[Out]

Integral((x + 4)/((x**2 + 2*x + 4)*sqrt(x**2 + 2*x + 5)), x)

________________________________________________________________________________________